package DesignPattern.CommandPattern;

import java.util.ArrayList;
import java.util.List;
 /**
  * invoker 使用命令对象的入口
  * */
public class Broker {
   private List<Command> commandList = new ArrayList<Command>();
 
   public void takeCommand(Command command){
      commandList.add(command);
   }
 
   public void placeCommand(){
      for (Command command : commandList) {
         command.execute();
      }
      commandList.clear();
   }
}